<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>gbmath: frustum.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.jpg"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">gbmath
   &#160;<span id="projectnumber">v0.051</span>
   </div>
   <div id="projectbrief">c++ math library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">frustum.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="frustum_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;﻿</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#ifndef __GBMATH_H__</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor"></span><span class="preprocessor">    #error  DO NOT INCLUDE THIS FILE. USE:   #include &lt;gbmath/_gbmath.h&gt;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor"></span> </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">namespace </span>gbmath</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;{</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div>
<div class="line"><a name="l00017"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html">   17</a></span>&#160;   <span class="keyword">class </span><a class="code" href="classgbmath_1_1frustum.html" title="frustum. Standard frustum ">frustum</a>  </div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;   {</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;   <span class="keyword">public</span>:</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html#a6436dc2d750d1c567d16a92124e0d38c">   21</a></span>&#160;        <a class="code" href="structgbmath_1_1plane__s.html" title="plane in 3d ">plane_s</a>  <a class="code" href="classgbmath_1_1frustum.html#a6436dc2d750d1c567d16a92124e0d38c">planes</a> [6] ;</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html#a368d3f83b1ea45d27912c6ff16c14bf4">   24</a></span>&#160;       <span class="keyword">inline</span> <a class="code" href="classgbmath_1_1frustum.html#a368d3f83b1ea45d27912c6ff16c14bf4">frustum</a>() </div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;       {</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;       }</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html#a12638ace0d6f8e6d3eabe509752398d5">   29</a></span>&#160;       <span class="keyword">inline</span> <a class="code" href="classgbmath_1_1frustum.html#a12638ace0d6f8e6d3eabe509752398d5">frustum</a>(<span class="keyword">const</span> <a class="code" href="classgbmath_1_1frustum.html" title="frustum. Standard frustum ">frustum</a>&amp; f) </div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;       { </div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;           *<span class="keyword">this</span> = f; </div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;       }</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html#ac9a2a71619ca8d12149343b82596d7dc">   35</a></span>&#160;       <span class="keyword">inline</span> <a class="code" href="classgbmath_1_1frustum.html#ac9a2a71619ca8d12149343b82596d7dc" title="construct and make ">frustum</a>(<span class="keyword">const</span>  <a class="code" href="structgbmath_1_1mat44.html" title="matrix 4x4. ">mat44</a>&amp; mViewProj)</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;       {</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;           <a class="code" href="classgbmath_1_1frustum.html#a480d3add013b9a2c846f9af2f143d712" title="Build the matrix product of the view * proj. ">make</a>(mViewProj);</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;       }</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;       <span class="keywordtype">void</span> <a class="code" href="classgbmath_1_1frustum.html#a480d3add013b9a2c846f9af2f143d712" title="Build the matrix product of the view * proj. ">make</a>(<span class="keyword">const</span>  <a class="code" href="structgbmath_1_1mat44.html" title="matrix 4x4. ">mat44</a>&amp; mViewProj);</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html#afc3679e8636dc8e823ff1c915b1ecafc">   45</a></span>&#160;       <span class="keywordtype">void</span> <a class="code" href="classgbmath_1_1frustum.html#afc3679e8636dc8e823ff1c915b1ecafc" title="Build the matrix product of the view and proj. ">make</a>(<span class="keyword">const</span>  <a class="code" href="structgbmath_1_1mat44.html" title="matrix 4x4. ">mat44</a>&amp; mView, <span class="keyword">const</span>  <a class="code" href="structgbmath_1_1mat44.html" title="matrix 4x4. ">mat44</a>&amp; mProj)</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;       {</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;            <a class="code" href="structgbmath_1_1mat44.html" title="matrix 4x4. ">mat44</a> mViewProj = mView * mProj;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;           <a class="code" href="classgbmath_1_1frustum.html#a480d3add013b9a2c846f9af2f143d712" title="Build the matrix product of the view * proj. ">make</a>(mViewProj);</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;       }</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;       <span class="keywordtype">bool</span> <a class="code" href="classgbmath_1_1frustum.html#a7d6f924d82506096f36017c85dd87a37" title="Verification of the point of the pyramid. ">checkPoint</a>(<span class="keyword">const</span>  <a class="code" href="structgbmath_1_1vec3.html" title="3d-base vector. Corrected by operators epislon ">vec3</a>&amp; <a class="code" href="structgbmath_1_1point.html" title="simple point (integer). ">point</a>) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;       <span class="keywordtype">bool</span> <a class="code" href="classgbmath_1_1frustum.html#a82245b34adccef7b9301bfc1c83cbc91" title="Hit Testing in the scope of the pyramid. ">checkSphere</a>(<span class="keyword">const</span> <a class="code" href="classgbmath_1_1sphere.html" title="The scope of the center point and radius. She Bounding sphere. ">sphere</a>&amp; <a class="code" href="classgbmath_1_1sphere.html" title="The scope of the center point and radius. She Bounding sphere. ">sphere</a>)  <span class="keyword">const</span>;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;       <span class="keywordtype">bool</span> <a class="code" href="classgbmath_1_1frustum.html#ab115367f00736ba45f0ac82ce22e6eb7" title="Hit Testing in the pyramid box. ">checkAABB</a>(<span class="keyword">const</span> <a class="code" href="classgbmath_1_1aabb.html" title="Axis Aligned Bounding Box by min and max points. ">aabb</a>&amp; <a class="code" href="classgbmath_1_1aabb.html" title="Axis Aligned Bounding Box by min and max points. ">aabb</a>) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;       </div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html#add09d5cb71add9fd418f511a80c527b6">   61</a></span>&#160;       <span class="keyword">const</span> <a class="code" href="structgbmath_1_1plane__s.html" title="plane in 3d ">plane_s</a>&amp; <a class="code" href="classgbmath_1_1frustum.html#add09d5cb71add9fd418f511a80c527b6">get_left</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="keyword">       </span>{</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="classgbmath_1_1frustum.html#a6436dc2d750d1c567d16a92124e0d38c">planes</a>[0];</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;       }</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html#a800ad806bd9795dc8f98733083388004">   66</a></span>&#160;       <span class="keyword">const</span> <a class="code" href="structgbmath_1_1plane__s.html" title="plane in 3d ">plane_s</a>&amp; <a class="code" href="classgbmath_1_1frustum.html#a800ad806bd9795dc8f98733083388004">get_right</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="keyword">       </span>{</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="classgbmath_1_1frustum.html#a6436dc2d750d1c567d16a92124e0d38c">planes</a>[1];</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;       }</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html#a7cfe2b8facead7b1616dfd6d7589a8fa">   71</a></span>&#160;       <span class="keyword">const</span> <a class="code" href="structgbmath_1_1plane__s.html" title="plane in 3d ">plane_s</a>&amp; <a class="code" href="classgbmath_1_1frustum.html#a7cfe2b8facead7b1616dfd6d7589a8fa">get_top</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="keyword">       </span>{</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="classgbmath_1_1frustum.html#a6436dc2d750d1c567d16a92124e0d38c">planes</a>[2];</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;       }</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html#a3632e0976da5e890515ec467878a4817">   76</a></span>&#160;       <span class="keyword">const</span> <a class="code" href="structgbmath_1_1plane__s.html" title="plane in 3d ">plane_s</a>&amp; <a class="code" href="classgbmath_1_1frustum.html#a3632e0976da5e890515ec467878a4817">get_bottom</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="keyword">       </span>{</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="classgbmath_1_1frustum.html#a6436dc2d750d1c567d16a92124e0d38c">planes</a>[3];</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;       }</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div>
<div class="line"><a name="l00081"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html#ab6e8e911dc503f8cc11cb582bcbc51ef">   81</a></span>&#160;       <span class="keyword">const</span> <a class="code" href="structgbmath_1_1plane__s.html" title="plane in 3d ">plane_s</a>&amp; <a class="code" href="classgbmath_1_1frustum.html#ab6e8e911dc503f8cc11cb582bcbc51ef">get_back</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="keyword">       </span>{</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="classgbmath_1_1frustum.html#a6436dc2d750d1c567d16a92124e0d38c">planes</a>[4];</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;       }</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html#ab6542530d91f36541f48844dfa9d722d">   86</a></span>&#160;       <span class="keyword">const</span> <a class="code" href="structgbmath_1_1plane__s.html" title="plane in 3d ">plane_s</a>&amp; <a class="code" href="classgbmath_1_1frustum.html#ab6542530d91f36541f48844dfa9d722d">get_front</a>()<span class="keyword"> const</span></div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="keyword">       </span>{</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;            <span class="keywordflow">return</span> <a class="code" href="classgbmath_1_1frustum.html#a6436dc2d750d1c567d16a92124e0d38c">planes</a>[5];</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;       }</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="code" href="classgbmath_1_1frustum.html#a7f1b7447d282df36c14fca6bbbd9809d">   92</a></span>&#160;     <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classgbmath_1_1frustum.html#a7f1b7447d282df36c14fca6bbbd9809d">operator &lt;&lt; </a>( std::ostream&amp; os, <span class="keyword">const</span> <a class="code" href="classgbmath_1_1frustum.html" title="frustum. Standard frustum ">frustum</a>&amp; fr )</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;     {</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        os  &lt;&lt; <span class="stringliteral">&quot;front  = &quot;</span> &lt;&lt; fr.<a class="code" href="classgbmath_1_1frustum.html#ab6542530d91f36541f48844dfa9d722d">get_front</a>()   &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        os  &lt;&lt; <span class="stringliteral">&quot;back   = &quot;</span> &lt;&lt; fr.<a class="code" href="classgbmath_1_1frustum.html#ab6e8e911dc503f8cc11cb582bcbc51ef">get_back</a>()    &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;        os  &lt;&lt; <span class="stringliteral">&quot;left   = &quot;</span> &lt;&lt; fr.<a class="code" href="classgbmath_1_1frustum.html#add09d5cb71add9fd418f511a80c527b6">get_left</a>()    &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;        os  &lt;&lt; <span class="stringliteral">&quot;right  = &quot;</span> &lt;&lt; fr.<a class="code" href="classgbmath_1_1frustum.html#a800ad806bd9795dc8f98733083388004">get_right</a>()   &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;        os  &lt;&lt; <span class="stringliteral">&quot;top    = &quot;</span> &lt;&lt; fr.<a class="code" href="classgbmath_1_1frustum.html#a7cfe2b8facead7b1616dfd6d7589a8fa">get_top</a>()     &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        os  &lt;&lt; <span class="stringliteral">&quot;bottom = &quot;</span> &lt;&lt; fr.<a class="code" href="classgbmath_1_1frustum.html#a3632e0976da5e890515ec467878a4817">get_bottom</a>()  &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        <span class="keywordflow">return</span> os;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;     }</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;   };</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<hr class="footer"/>
<!--address class="footer"-->
<!--small-->
<br>
&nbsp;&nbsp;&nbsp;<b>Project page:</b> &nbsp;<a target="_blank" href="https://code.google.com/p/gbmath/">https://code.google.com/p/gbmath/</a>&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;<b>Doc page:</b> &nbsp;<a target="_blank" href="http://www.it.ks777.ru/docs">http://www.it.ks777.ru/docs</a>&nbsp;&nbsp;<br>
<br>
Generated on Sat Jul 27 2013 08:09:04 for gbmath by &#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
